Method and system for vision-based defect detection

ABSTRACT

A method and a system for vision-based defect detection are proposed. The method includes the following steps. A test audio signal is outputted to a device-under-test (DUT), and a response signal of the DUT with respect to the test audio signal is received to generate a received audio signal. Signal processing is performed on the received audio signal to generate a spectrogram, and whether the DUT has a defect is determined through computer vision according to the spectrogram.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the priority benefit of Taiwan application serial no. 108137945, filed on Oct. 21, 2019. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification.

TECHNICAL FIELD

The disclosure relates to a detection technique, and more particularly, to a method and a system for vision-based defect detection.

BACKGROUND

A speaker is a transducer that converts electrical signals to audio signals widely used in devices including audio electronics, earphones and the like, and its performance affects the use of these devices. Traditionally, rub and buzz of the speaker are detected by experienced listeners at the end of the production line. This type of detection requires a log-swept sine chirps to be applied to the speaker and uses human auditory detection to analyze whether a response signal is normal. However, such a result detected by the human ear may vary with the subjective factors such as the age, mood change, and hearing fatigue of the listener, and is likely to cause occupational injury to the listener.

SUMMARY

The disclosure provides a method and a system for vision-based defect detection, which can detect whether a device-under-test (DUT) has a defect through computer vision from a spectrogram.

In an embodiment of the disclosure, the method includes the following steps. A test audio signal is outputted to the DUT, and a response signal of the DUT with respect to the test audio signal is received to generate a received audio signal. Signal processing is performed on the received audio signal to generate the spectrogram and whether the DUT has the defect is determined through computer vision according to the spectrogram.

In an embodiment of the disclosure, the system includes a signal outputting device, a microphone, an analog-to-digital converter and a processing device. The signal outputting device is configured to output a test audio signal to the DUT. The microphone is configured to receive a response signal of the DUT with respect to the test audio signal. The analog-to-digital converter is configured to convert the response signal to a received audio signal. The processing device is configured to perform signal processing on the received audio signal to generate a spectrogram and determine whether the DUT has a defect through computer vision according to the spectrogram.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the disclosure and, together with the description, serve to explain the principles of the disclosure.

FIG. 1 is a block diagram illustrating a defect detection system according to an embodiment of the disclosure.

FIG. 2 is a flowchart illustrating a method for vision-based defect detection according to an embodiment of the disclosure.

FIG. 3 is a schematic diagram illustrating a spectrogram according an embodiment of the disclosure.

FIG. 4 is a functional block diagram illustrating a construction of a classifier according to an embodiment of the disclosure.

FIG. 5 is a functional block diagram illustrating a method for obtaining a spatial feature according to an embodiment of the disclosure.

FIG. 6 is a functional block flowchart illustrating a method for vision-based defect detection according to an embodiment of the disclosure.

FIG. 7 is a schematic diagram illustrating a spectrogram according an embodiment of the disclosure.

DESCRIPTION OF THE EMBODIMENTS

Reference will now be made in detail to the present preferred embodiments of the disclosure, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts.

Some embodiments of the disclosure are described in details below by reference with the accompanying drawings, and as for reference numbers cited in the following description, the same reference numbers in difference drawings are referring to the same or like parts. The embodiments are merely a part of the disclosure rather than disclosing all possible embodiments of the disclosure. More specifically, these embodiments are simply examples of the method and the system recited in claims of the disclosure.

FIG. 1 is a block diagram illustrating a defect detection system according to an embodiment of the disclosure. It should, however, be noted that this is merely an illustrative example and the disclosure is not limited in this regard. All components of the defect detection system and their configurations are first introduced in FIG. 1. The functionalities of the components are disclosed in more detail in conjunction with FIG. 2.

Referring to FIG. 1, a defect detection system 100 includes a signal outputting device 110, a microphone 120, an analog-to-digital converter 130 and a processing device 140, which is configured to detect whether a device-under-test (DUT) T has a defect.

The signal outputting device 110 is configured to output a test audio signal to the DUT T, which may be, for example, an electronic device having a digital audio outputting interface. The test audio signal is outputted to the DUT T in wireless or wired manner. The microphone 120 is configured to receive a response of the UDT T with respect to the test audio signal, and may be disposed in the vicinity of the DUT T or at a best receiving position with respect to the DUT T. The analog-to-digital converter 130 is connected to the microphone 120, and is configured to convert an analog sound received by the microphone 120 to a digital sound signal.

The processing device 140 is connected to the analog-to-digital converter 130, and is configured to process the digital sound signal received from the analog-to-digital converter 130 so as to detect whether the DUT T has a defect. The processing device 140 includes a memory and a processor. The memory may be, for example, a fixed or movable device in any possible forms, including a random access memory (RAM), a read-only memory (ROM), a flash memory, a hard drive or other similar devices, integrated circuits or a combination of the above-mentioned devices. The processor may be, for example, a central processing unit (CPU), an application processor (AP) or other programmable microprocessors for general purpose or special purpose, a digital signal processor (DSP), or other similar devices, integrated circuits and a combination of the above.

It should be noted that in an embodiment, the signal outputting device 110, the microphone 120, the analogue-to-digital converter 130 and the processing device 140 may respectively belong to four separate devices. In an embodiment, the signal outputting device 110 and the processing device 140 may be integrated into the same device, and the processing device 140 can control outputting of the signal outputting device 110. In an embodiment, the signal outputting device 110, the microphone 120, the analog-to-digital converter 130 and the processing device 140 may also be an all-in-one computer system. The disclosure does not impose any limitation on integration of the signal output device 110, the microphone 120, the analog-to-digital converter 130 and the processing device 140. Any systems including such devices are within the scope of defect detection system 100.

Embodiments are provided below to describe detailed steps in a defect detection method used by the defect detection system 100 for the DUT T. The following embodiment is described by using an electronic device having a speaker as an example of the DUT T, and the defect to be detected by the defect detection system 100 is rub and buzz of the DUT T.

FIG. 2 is a flowchart illustrating a method for vision-based defect detection according to an embodiment of the disclosure, and the flow of FIG. 2 is performed by the defect detection system 100 of FIG. 1.

Referring to FIG. 1 and FIG. 2 together, the signal outputting device 110 outputs the test audio signal to the DUT T (step S202), the microphone 120 receives a response signal of the DUT T with respect to the test audio signal (step S204), and the analog-to-digital converter 130 converts the response signal to a received audio signal (step S206). Here, an audio range of the test audio signal may be 1K to 20 Hz, in which an amplitude of 1K to 500 Hz is −25 dB, an amplitude of 500 Hz to 300 Hz is −15 dB and an amplitude of 300 Hz to 20 Hz is −8 dB. However, since the rub and buzz will generate a resonance with a specific frequency point of the test audio signal, in order to prevent a resonance not belonging to the rub and buzz (e.g., a button resonance) from affecting the detection of the rub and buzz, the audio range and the amplitude of the test audio signal are adjusted according to the DUT T. The DUT T will generate the response signal with respect to the test audio signal, and the microphone 120 will receive the response signal from the DUT T. Next, the analog-to-digital converter 130 performs analog-to-digital conversion on the analog response signal to a digital response signal (hereinafter referred to as “a received audio signal”).

The processing device 140 performs signal processing on the received audio signal to generate a spectrogram (step S208), and determines whether the DUT T has the defect through computer vision according to the spectrogram (step S210). The processing device 140 may perform Fast Fourier Transform (FFT) on the received audio signal to generate the spectrogram. Here, the reason why the received audio signal is converted to the spectrogram is that the rub and buzz does not have a significant feature in the received audio signal, and yet the rub and buzz can have a time continuity when having a resonance with the received audio signal. Therefore, if a time domain signal is converted to the spectrogram, the feature of the rub and buzz will exhibit time-continuous and energy clustering in the spectrogram, which can used to achieve the defect detection on the DUT through computer vision.

In an example of FIG. 3, which is a schematic diagram illustrating a spectrogram according an embodiment of the disclosure, a spectrogram 310 corresponds to a sound signal without the rub and buzz, and a spectrogram 320 corresponds to a sound signal with the rub and buzz. It should be noted that those skilled in the art should understand that the spectrogram represents a distribution of signal strength over time and frequency, and the spectrogram 310 and the spectrogram 320 simply show significant signal strengths by curves. Here, the sound signal with the rub and buzz has the feature of time-continuous and energy clustering in the spectrogram 320 (i.e., rub and buzz RB). Therefore, if the processing device 140 is used to analyze the spectrogram through computer vision, whether the UDT T has the rub and buzz due to an assembly detect can then be detected.

In the following embodiment, a classifier is used to perform image recognition. Accordingly, before the processing device 140 detects whether the UDT T has the defect, a trained classifier will be obtained. Here, the classifier may be trained by the processing device 140 itself, or may be a classifier trained by other processing devices, which are not particularly limited in the disclosure.

FIG. 4 is a functional block diagram illustrating a construction of a classifier according to an embodiment of the disclosure. In the following embodiment, the construction of the classifier is performed by a device similar to the processing device 140 (hereinafter referred to as “a training system”).

Referring to FIG. 4, first of all, the training system collects a plurality of training data 402. Here, the training data may be N1 non-defective training sound samples and N2 defective training sound samples respectively generated from N1 non-defective training objects and N2 defective training objects in a manner similar to steps S202 to S204. Here, the N1+N2 training objects and the UDT T are of a same object but have passed the defect detection in advance.

Then, the training system converts the training data to a spectrogram 404. In order to reduce the computational complexity and to avoid low frequency noise and high frequency noise images, the training system selects a preset frequency range of, for example, 3K to 15K Hz as an inspection region. In the example of FIG. 3, a region 315 is an inspection region of the spectrogram 310, and a region 325 is an inspection region of the spectrogram 320. For descriptive convenience, hereinafter, the inspection regions in the spectrogram corresponding to the non-defective training sound samples are referred to as “non-defective inspection region images”, and the inspection regions in the spectrogram corresponding to the defective training sound samples are referred to as “defective inspection region images”.

Then, the training system obtains feature values corresponding to the different regions in each of the defective inspection region images and each of the non-defective inspection region images, and obtains texture correlation 406 of each of the defective inspection region images and each of the non-defective inspection region images with respect to a reference model 408 as a spatial feature 410 to train a training classifier 412 and thereby generate a classifier 414 for detecting whether the UDT T has the defect.

Here, the training system performs image segmentation on all of the defective inspection region images and the non-defective inspection region images to generate a plurality of sub-blocks of a same size (e.g., a pixel size of 40×200). In this embodiment, if the size of the sub-block is too large, a proportion of the feature of the rub and buzz will be reduced; and if the size of the sub-block is too small, the feature of the rub and buzz will not be covered and a subsequent recognition result will be affected. Therefore, the training system may obtain the spatial feature of each of the defective inspection region images and the non-defective inspection region images according to FIG. 5, which is a functional block diagram illustrating a method for obtaining a spatial feature according to an embodiment of the disclosure.

Referring to FIG. 5, the training system performs image pyramid processing H on each of the defective inspection region images and the non-defective inspection region images to generate images with different scales. In this embodiment, there are two scales, which are an original image size and ¼ of the original image size (a length and a width of an original image are reduced to ½ of the original image respectively). Here, the flow of FIG. 5 is described by using one of the defective inspection region images, and those skilled in the art can analogize a processing manner for the rest of the defective inspection region images and the non-defective inspection region images. It is assumed that T1 is one of the defective inspection region images having a pixel size of 1000×800. T11 is one of the sub-blocks after image segmentation (hereinafter referred to as “a training sub-block”) having a pixel size of 40×200. On the other hand, T0 is an image having a pixel size of 500×400 generated by performing image pyramid processing (reduction processing) on T1. T01 is one of the training sub-blocks after image segmentation having a pixel size the same as the training sub-block T11, i.e., the pixel size of 40×200.

Next, the training system performs a feature extraction FE on each of the training sub-blocks segmented from each of the non-defective inspection region images and the defective inspection region images with different scales. In this embodiment, the training system can compute at least one of a standard deviation a and a Kurtosis of pixel values of each of the training sub-blocks k as the feature value of each of the training sub-blocks, but the disclosure is not limited thereto. In addition, in order to improve differentiation between non-defective and defective, the training system can generate a reference model associated with non-defective according to the N1 non-defective inspection region images. For instance, the training system can obtain the reference model by averaging the pixel values of the N1 non-defective inspection region images of the same scale. In this way, each scale can have its own corresponding reference model. In this embodiment, the training system generates a reference model R1 corresponding to the image T1 and a reference model R0 corresponding to the image T0. Here, because the reference model R1 and the image T1 have the same scale, the training sub-block in the image T1 can locate the corresponding sub-block (hereinafter referred to as “a reference sub-block”) in the reference model R1. Similarly, because T0 and the reference model R0 have the same scale, the training sub-block in the image T0 can locate the corresponding reference sub-block in the reference model R0.

Next, the training system computes the texture correlation between each of the sub-blocks of each scale and the reference sub-blocks in the corresponding reference model. Specifically, the training system computes the texture correlation between the training sub-block T11 and the reference sub-block R11 and computes the texture correlation between the training sub-block T01 and the reference sub-block R01. Here, the texture correlation may be a correlation coefficient coeff of a local binary pattern (LBP) between the sub-block and the reference sub-block.

Here, each sub-block has a feature vector f={σ,k,coeff} of its own, and each image has an image feature vector F={f₁, f₂, . . . , f_(n)} of its own, wherein n is the number of the sub-blocks. Taking FIG. 5 as an example, the defective inspection region image T1 will have an image feature vector F¹=f₁ ¹, f₂ ¹, . . . , f_(n1) ¹, wherein n₁ is the number of the training sub-blocks in the defective inspection region image T1. Similarly, the defective inspection region image T0 will have an image feature vector F⁰=f₁ ⁰, f₂ ⁰, . . . , f_(n0) ⁰, wherein n₀ is the number of the training sub-blocks in the image T0. Then, the training system may concatenate the image feature vectors with two scales together as a feature vector F={F⁰,F¹} to be inputted to a classifier M.

After all the feature vectors corresponding to the N1+N2 training data to the classifier are being inputted, the training system starts to train the classifier M. Here, the classifier may be a support vector machines (SVM) classifier. Accordingly, the training system computes an optimal separating hyperplane of the SVM classifier as a basis for distinguishing whether the DUT T has the defect.

FIG. 6 is a functional block flowchart illustrating a method for vision-based defect detection according to an embodiment of the disclosure, and the flow of FIG. 6 is adapted to the defect detection system 100 of FIG. 1. Before the flow of FIG. 6 is performed, the processing device 140 pre-stores the reference model and the classifier mentioned by FIG. 5.

Referring to FIG. 1 and FIG. 6 together, first, as similar to step S206 and step S208, the processing device 140 obtains testing data 602 (i.e., the received audio signal corresponding to the DUT T), and converts the testing data to a spectrogram 604. Here, the testing data is the received audio signal in step S206.

Next, the processing device 140 obtains a plurality of sub-blocks associated with the spectrogram, and obtains a spatial feature 610 therefrom to be inputted to a classifier 612. In this embodiment, the processing device 140 also uses, for example, the preset frequency range of 3K to 15K Hz as the inspection region to generate an inspection region image. In an embodiment, the processing device 140 may directly segment the inspection region image to directly generate a plurality of sub-blocks of a same size. In another embodiment, the processing device 140 may perform image pyramid processing on the inspection region image to generate a plurality of inspection region images with different scales. Next, the processing device 140 segments the inspection region images with different scales to generate a plurality of sub-blocks of a same size.

Then, the processing device 140 obtains a feature value of each of the sub-blocks and obtains texture correlation 606 between each of the sub-blocks with respect to a reference model 608. Here, the feature value is, for example, at least one of a standard deviation and a Kurtosis of a plurality of pixel values of the sub-block, but needs to meet an input requirement of a pre-stored classifier. Here, the texture correlation may be a correlation coefficient of a local binary pattern between the sub-block and the reference sub-block corresponding to the reference model. Next, the processing device 140 then inputs the feature value and the texture correlation corresponding to each of the sub-blocks to the classifier 612 to generate an output result. This output result indicates whether the DUT T has the defect.

In this embodiment, in order to achieve a more rigorous detection and avoid the fact that the DUT T is being mistaken as non-defective, when the output result indicates that the DUT T does not have the defect, the processing device 140 may conduct a further confirmation according to reliability of the output result. In detail, taking the SVM classifier as an example, the processing device 140 can obtain a confidence level of the output result, and determine whether the confidence level is greater than a preset confidence threshold 614, wherein the preset confidence threshold may be 0.75. If true, the processing device 140 determines that the DUT T does not have the defect. Otherwise, the processing device 140 determines that the DUT T has the defect.

In this embodiment, the defect detected by the defect detection system 100 is the rub and buzz of the DUT T. Since different types of the rub and buzz generate resonance harmonics when a specific audio signal is played, the processing device 140 can further utilize a frequency and a harmonic frequency range of the rub and buzz in the spectrogram to identify a component in the DUT that causes the rub and buzz. From another perspective, the processing device 140 identifies the component in the DUT that causes the rub and buzz according to a specific region of the spectrogram.

For instance, FIG. 7 is a schematic diagram illustrating a spectrogram according an embodiment of the disclosure, and only some regions in the spectrogram are illustrated below. Both a spectrogram 710 and a spectrogram 720 have the rub and buzz. Since a resonance frequency point when a screw is not securely locked is a single point resonance of 460 Hz, the processing device 140 can derive from the spectrogram 710 that the screw of the DUT T is not securely locked. Since a resonance sound caused by iron filings in a speaker monomer resonates from 460 to 350 Hz, the processing device 140 can derive from the spectrogram 720 that there are iron filings in the DUT T.

In summary, the method and the system for vision-based defect detection proposed by the disclosure can detect whether DUT has the defect from the spectrogram through computer vision. In this way, the disclosure can provide a more accurate defect detection than subjective determination of the human ear, and can reduce related occupational injuries.

It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present disclosure without departing from the scope or spirit of the disclosure. In view of the foregoing, it is intended that the present disclosure cover modifications and variations of this disclosure provided they fall within the scope of the following claims and their equivalents. 

What is claimed is:
 1. A method for vision-based defect detection comprising: outputting a test audio signal to a device-under-test (DUT); receiving a response signal of the DUT with respect to the test audio signal to generate a received audio signal; performing signal processing on the received audio signal to generate a spectrogram; and determining whether the DUT has a defect through computer vision according to the spectrogram.
 2. The method according to claim 1, wherein the step of receiving the response signal of the DUT with respect to the test audio signal to generate the received audio signal comprises: receiving the response signal by using a microphone; and performing analog-to-digital conversion on the response signal to generate the received audio signal.
 3. The method according to claim 2, wherein the step of performing signal processing on the received audio signal to generate the spectrogram comprises: performing fast Fourier transform (FFT) on the received audio signal to generate the spectrogram.
 4. The method according to claim 1, wherein the step of determining whether the DUT has the defect through computer vision according to the spectrogram comprises: obtaining a plurality of sub-blocks associated with the spectrogram, wherein each of the sub-blocks is of a same size; generating an output result by using the sub-blocks and a classifier; and determining whether the DUT has the defect according to the output result.
 5. The method according to claim 4, wherein the step of obtaining the sub-blocks associated with the spectrogram comprises: setting an inspection region of the spectrogram to generate an inspection region image, wherein the inspection region image corresponds to a preset frequency range; and segmenting the inspection region image to generate the sub-blocks.
 6. The method according to claim 4, wherein the step of obtaining the sub-blocks associated with the spectrogram comprises: performing image pyramid processing on the inspection region image with different scales to respectively generate a plurality of inspection region images with different scales; and segmenting each of the inspection region images with different scales to generate the sub-blocks.
 7. The method according to claim 4, wherein the step of generating the output result by using the sub-blocks and the classifier comprises: computing at least one feature value of each of the sub-blocks; computing texture correlation between each of the sub-blocks and a reference model associated with no defect; and generating the output result by using the classifier according to the at least one feature value and the texture correlation of each of the sub-blocks.
 8. The method according to claim 7, wherein the at least one feature value of each of the sub-blocks comprises at least one of a standard deviation and a Kurtosis of a plurality of pixel values of the sub-block.
 9. The method according to claim 7, wherein the texture correlation between each of the sub-blocks and the reference model is a correlation coefficient of a local binary pattern between the sub-block and the reference model.
 10. The method according to claim 4, wherein the classifier is a support vector machines (SVM) classifier, and the step of determining whether the DUT has the defect according to the output result comprises: in response to the output result indicating that the DUT has the defect, determining that the DUT has the defect; and in response to the output result indicating that the DUT does not have the defect: obtaining a confidence level of the output result; determining whether the confidence level of the output result is greater than a preset confidence threshold; in response to the confidence level of the output result being greater than the preset confidence threshold, determining that the DUT does not have the defect; and in response to the confidence level of the output result not being greater than the preset confidence threshold, determining that the DUT has the defect.
 11. The method according to claim 4, wherein a construction method of the classifier comprises: obtaining a plurality of non-defective inspection region images of a plurality of non-defective training objects and a plurality of defective inspection region images of a plurality of defective training objects, wherein the non-defective training objects, the defective training objects, and the DUT are same objects; performing image pyramid processing on each of the non-defective inspection region images and each of the defective inspection region images with different scales to respectively generate a plurality of non-defective inspection region images with different scales and a plurality of defective inspection region images with different scales; segmenting each of the non-defective inspection region images with different scales and each of the defective inspection region images with different scales to generate a plurality of training sub-blocks, wherein each of the training sub-blocks is of a same size; and training the classifier by using the training sub-blocks.
 12. The method according to claim 11, further comprising: generating a reference model associated with no defect according to the non-defective inspection region images, wherein the reference model has reference sub-blocks respectively corresponding to each of the training sub-blocks.
 13. The method according to claim 1, wherein the DUT is an electronic device having a speaker.
 14. The method according to claim 1, wherein the defect is rub and buzz of the DUT.
 15. The method according to claim 14, wherein in response to determining that the DUT has the defect, the method further comprises: identifying a component in the DUT that causes the rub and buzz according to a specific region of the spectrogram.
 16. A defect detection system comprising: a signal outputting device, configured to output a test audio signal to a device-under-test (DUT); a microphone, configured to receive a response signal of the DUT with respect to the test audio signal; an analog-to-digital converter, configured to convert the response signal to a received audio signal; and a processing device, configured to perform signal processing on the received audio signal to generate a spectrogram and determine whether the DUT has a defect through computer vision according to the spectrogram.
 17. The system according to claim 16, wherein the processing device further pre-stores a classifier, and the processing device is configured to: obtain a plurality of sub-blocks associated with the spectrogram, wherein each of the sub-blocks is of a same size; generate an output result by using the sub-blocks and the classifier; and determine whether the DUT has the defect according to the output result.
 18. The system according to claim 16, wherein the DUT is an electronic device having a speaker.
 19. The system according to claim 16, wherein the defect is rub and buzz of the DUT.
 20. The system according to claim 19, wherein in response to the processing device determines that the DUT has the defect, the processing device further identifies a component in the DUT that causes the rub and buzz according to a specific region of the spectrogram. 